Skip to content

[1/15] Route error responses back through the interceptor chain - #154

Open
UnknownJoe796 wants to merge 2 commits into
version-5.3from
v53/core-request-handling
Open

[1/15] Route error responses back through the interceptor chain#154
UnknownJoe796 wants to merge 2 commits into
version-5.3from
v53/core-request-handling

Conversation

@UnknownJoe796

Copy link
Copy Markdown
Contributor

An exception short-circuited the interceptor chain, so responses built from
errors skipped everything downstream -- logging, headers, CORS. Error responses
now travel back through the chain.

Map handler, routing, timeout, and compression exceptions to HTTP
responses *inside* the compiled interceptor chain instead of outside it,
so error responses still receive interceptor post-processing. The
motivating case is CORS: without this, 4xx/5xx responses shipped without
Access-Control-Allow-Origin, and browsers masked the real error as a
generic CORS failure. An outer catch remains as a safety net for
exceptions thrown by an interceptor itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 3a5031f)
@iHoonter
iHoonter self-requested a review July 31, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants